# coding=utf-8
'''
Created on Oct 26, 2009

@author: gpossum
'''

class Struct:

    def _compile(self):
        _values = {}
        for name in [name for name in dir(self) if name[0] != '_']:
            _values[name] = getattr(self, name)
        return _values



class Enumerate(object):
    '''
    handmade enumerate
    '''

    def __init__(self, names):
        '''
        create enum by tuples of names
        '''
        setattr(self, 'list', names)
        for str in names:
            setattr(self, str, str)



roles = Enumerate(('user', 'spectator', 'admin'))
